<!DOCTYPE html>
<html>
    <head>
        <?= HTMLManager::get_head_content() ?>
        <?php 
            if ($_GET['action'] == ACTION_ARTICLE_READ) {
            ?>
                <title><?= $article->title ?> :: salesianichioggia.it</title>
            <?php
            } else {
            ?>
                <title>Archivio :: salesianichioggia.it</title>
            <?php
            }
        ?>
        
        <style>
            #social_share li {
                margin: 15px 0px;
            }
        </style>
        <script>
            $(document).ready(function(){
                $('a.scroll').click(function() {
                    var elementClicked = $(this).attr("href");
                    var destination = $(elementClicked).offset().top;
                    $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
                    return false;
                });
            });
        </script>
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
    </head>
    <body>
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1&appId=288682984504293";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <?= HTMLManager::get_header() ?>
        <div class="container">
            <div class="row">
                <div class="span3">
                    <?php if ($_GET['action'] == ACTION_ARTICLE_READ) { ?>
                        <ul class="nav nav-pills nav-stacked">
                            <li class="active"><a class="scroll" href="#article">Articolo</a></li>
                            <li><a class="scroll" href="#links">Link Utili</a></li>
                            <li><a class="scroll" href="#stuffs">Materiale</a></li>
                            <li><a class="scroll" href="#tags">Tags</a></li>

                        </ul>
                        <h2>Condividi</h2>
                        <ul class="unstyled" id="social_share">
                            <li><div class="fb-like" data-href="http://www.salesianichioggia.it/<?= $article->get_seo_link() ?>" data-send="false" data-layout="box_count" data-width="120" data-show-faces="false"></div></li>
                            <li><a href="https://twitter.com/share" class="twitter-share-button" data-lang="it" data-size="large">Tweet</a></li>
                            <li><div class="g-plusone" data-size="tall"></div></li>
                            <li><a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.salesianichioggia.it%3F<?= $article->get_seo_link() ?>" class="pin-it-button" count-layout="vertical"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></li>
                        </ul>
                        <?php
                    } else if ($_GET['action'] == ACTION_ARTICLE_ARCHIVE) {
                        HTMLManager::get_sidebar_categories_menu((isset($_GET['type_id'])) ? $_GET['type_id'] : '');
                    }
                    ?>
                </div>
                <div class="span9">
                    <?php
                    if ($_GET['action'] == ACTION_ARTICLE_READ) {
                        $article->get_html_article();
                    } else if ($_GET['action'] == ACTION_ARTICLE_ARCHIVE) {
                        ?>
                        <h1 class="archive">Archivio</h1>
                        <section class="articles">
                            <?php
                            foreach ($articles as $article) {
                                $article->get_html_article_preview();
                                echo '<hr />';
                            }
                            ?>
                        </section>
                        <?php
                        if ($num_pages > 1) {
                            HTMLManager::get_page_navigation($num_pages, $current_page, $url);
                        }
                    }
                    ?>
                </div>
            </div>
        </div>
        <?= HTMLManager::get_footer() ?>

        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
        <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
        <script type="text/javascript">
        window.___gcfg = {lang: 'it'};

        (function() {
            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
            po.src = 'https://apis.google.com/js/plusone.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
        })();
        </script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-transition.js" type="text/javascript"></script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-carousel.js" type="text/javascript"></script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-tooltip.js" type="text/javascript"></script>
        <script src="http://www.salesianichioggia.it/bootstrap/js/bootstrap-popover.js" type="text/javascript"></script>
    </body>
</html>